import sys
import re
from PySide6.QtCore import QThread, Signal, Slot
from PySide6.QtWidgets import QApplication, QMainWindow, QPushButton

class WorkerThread(QThread):
    def __init__(self):
        super().__init__()

    def run(self):
        # 子线程中的代码
        print("子线程中的代码")
        aa=re.findall(r'@edo[]','wqwif_w')

class MainWindow(QMainWindow):
    def __init__(self):
        super().__init__()

        self.button = QPushButton("启动子线程", self)
        self.button.clicked.connect(self.start_worker_thread)

    def start_worker_thread(self):
        self.worker_thread = WorkerThread()
        self.worker_thread.start()

if __name__ == "__main__":
    app = QApplication(sys.argv)
    main_window = MainWindow()
    main_window.show()
    sys.exit(app.exec())